<?php $this->headScript()->captureStart() ?>
$(document).ready(function() {
    var options1 = { 
        type:"POST",
        dataType : "text",
        buttons:$('#mainForm').find("button[name='button']"),
        async : true,
        cache: false,
        success:function(responseText, statusText)
        {
            var json = jQuery.parseJSON(responseText);

            dialogMessage(json.messages);

            return true;
        },
    };
    var v = jQuery("#mainForm").validate({
        debug: true,
        messages: {
            //description: "",
        },
        errorPlacement: function(error, element) {
            error.appendTo(element.parent());  
        },
        submitHandler: function(form) {
            jQuery(form).ajaxSubmit(options1);
        }
    });
});
<?php $this->headScript()->captureEnd() ?>

<?php 
    echo $this->headLink()
        ->appendStylesheet($this->baseUrl('ui/style/base/'.$this->settings['styleBase'].'/publish.css'))
    ;
?>

<div class="container">
    
    <?php if($this->settings['allowUploadImage'] || $this->settings['allowShareVideo'] || $this->settings['allowShareMusic']):?>
    <dl class="formUiB">
        <?php 
        echo $this->partial('module_publish_script_attachments-add.phtml', array(
            'articleId'          => $this->articleId,
            'allowVideoHosts'    => $this->allowVideoHosts,
            'allowMusicHosts'    => $this->allowMusicHosts,
            'allowShoppingHosts' => $this->allowShoppingHosts,
            'articleId'          => $this->articleId,
            'settings'           => $this->settings,
        ));            
        ?>
    </dl>
    <?php endif;?>
    
    <form method="post" name="mainForm" id="mainForma" action="<?php echo $this->url(array('module'=>'publish', 'controller'=>'article', 'action'=>'save-post'),'default',true) ?>">
    <input type="hidden" name="articleId" value="<?php echo $this->articleId;?>" />

    <dl class="formUiB">
        <dt><?php echo $this->translate("Title");?></dt>
        <dd> 
              <div class="">
                   <input type="text" id="title" name="title" value="<?php echo $this->title;?>" class="text ui-corner-all" />
            </div> 
            <div id="titleTip"></div>
        </dd>
    </dl>
    
    <?php if($this->settings['allowUploadImage'] || $this->settings['allowShareVideo'] || $this->settings['allowShareMusic']):?>
    <dl class="formUiB">
        <?php 
        echo $this->partial('module_publish_script_attachments-list.phtml', array(
            'articleId'   => $this->articleId,
            'attachments' => $this->attachments,
            'settings'    => $this->settings,
        ));            
        ?>
    </dl>
    <?php endif;?>

    <dl class="formUiB">
        <?php 
        echo $this->partial('module_publish_script_description.phtml', array(
            'description'   => $this->description,
        ));            
        ?>
        
        <?php 
        echo $this->partial('module_publish_script_tag.phtml', array(
            'recommendTags' => $this->recommendTags,
            'definedTags'   => $this->definedTags,
        ));            
        ?>
    </dl>
    
    <dl class="formUiB">
        <dt></dt>
        <dd>
            <input type="submit" name="submit" id="submit" value=" <?php echo $this->translate('Submit');?> ">
        </dd>
    </dl>

    </form>

</div>


